package com.yequan.designpattern.composite.safe;

/**
 * @author yequan
 * @date 2019/12/11
 */
public class Test {

    public static void main(String[] args) {
        Folder root = new Folder("root");
        Folder users = new Folder("users");
        Folder bin = new Folder("bin");

        Folder liBai = new Folder("LiBai");
        Folder baiJuyi = new Folder("BaiJuyi");

        Image libaiImage = new Image("李白画像");
        Txt libaiTxt = new Txt("李白生平简介");
        Image baijuyiImage = new Image("白居易画像");
        Txt baijuyiTxt = new Txt("白居易生平简介");

        liBai.add(libaiImage);
        liBai.add(libaiTxt);

        baiJuyi.add(baijuyiImage);
        baiJuyi.add(baijuyiTxt);

        users.add(liBai);
        users.add(baiJuyi);

        root.add(users);
        root.add(bin);

        root.showSelf(0);
    }

}
